#include <stdio.h>
#include <string.h>
#include <unistd.h>

int main()
{
  char pb[102];
  memset(pb,'\0',102);
  int i = 0;
  char arr[4];
  arr[0] = '\\';
  arr[1] = '|';
  arr[2] = '/';
  arr[3] = '-';
  while (i != 100)
  {
    pb[i] = '#';
    printf("[%-100s][%%%d][%c]\r",pb,i+1,arr[i%4]);
    fflush(stdout);
    usleep(50000);
    i++;
  }
  return 0;
}
